import {request} from "../utils/request";

//发起帮组
export async function createRoom() {
    const res = await request({
        url: `/guildLeader/room`,
        method: 'GET',
    }).catch()
    return res
}

//帮组加入房间
export async function joinRoom(data) {
    const res = await request({
        url: `/guildLeader/room`,
        header:{
            'content-type':'application/x-www-form-urlencoded'
        },
        method: 'POST',
        data
    }).catch()
    return res
}

//删除房间
export async function delRoom() {
    const res = await request({
        url: `/guildLeader/room`,
        method: 'DELETE',
    }).catch()
    return res
}

//踢出用户
export async function delUser(data) {
    const res = await request({
        url: `/guildLeader/kickroom`,
        header:{
            'content-type':'application/x-www-form-urlencoded'
        },
        method: 'POST',
        data
    }).catch()
    return res
}

//通过用户id获取房间号
export async function getRoomByUserId(data) {
    const res = await request({
        url: `/guildLeader/getroomid`,
        header:{
            'content-type':'application/x-www-form-urlencoded'
        },
        method: 'GET',
        data
    }).catch()
    return res
}

//邀请互娱师加入帮组
export async function inviteGamer(data) {
    const res = await request({
        url: `/guildLeader/invitegamer`,
        header:{
            'content-type':'application/x-www-form-urlencoded'
        },
        method: 'POST',
        data
    }).catch()
    return res
}

//退出房间
export async function quitRoom(data) {
    const res = await request({
        url: `/guildLeader/quitroom`,
        header:{
            'content-type':'application/x-www-form-urlencoded'
        },
        method: 'POST',
        data
    }).catch()
    return res
}
